4449aaa0f679ef6ebca290c21e8065f1da241fb3,components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java,DefaultRestletBinding,populateRestletResponseFromExchange,#Exchange#Response#,168

Before Change


        if (LOG.isDebugEnabled()) {
            LOG.debug("Populate Restlet response from exchange body: " + text);
        }
        response.setEntity(text, mediaType);

        if (exchange.getProperty(Exchange.CHARSET_NAME) != null) {
            CharacterSet cs = CharacterSet.valueOf(exchange.getProperty(Exchange.CHARSET_NAME, String.class));

After Change


            response.setEntity(new InputRepresentation(out.getBody(InputStream.class), mediaType));
        } else if (body instanceof File) {
            response.setEntity(new FileRepresentation(out.getBody(File.class), mediaType));
        } else if (body != null) {
            // fallback and use string
            String text = out.getBody(String.class);
            response.setEntity(text, mediaType);
        }
        if (LOG.isDebugEnabled()) {
            LOG.debug("Populate Restlet response from exchange body: " + body);